<template>
	
	<uni-card :title="friendDetail.friendNickName" :sub-title="friendDetail.friendUserName" extra="" :thumbnail="imageUrl+friendDetail.friendPortrait" >
		<text class="uni-body">{{friendDetail.friendIntroduction}}</text>
	</uni-card>
				<uni-card   v-for="item in friendNoteList">
					<!-- <image slot='cover' style="width: 100%;" :src="cover"></image> -->
					
					<rich-text :nodes="item.context"></rich-text>
					<view style="border-top: 1px #eee solid;">
						<uni-icons type="fire" size="18" color="#999" v-if="item.topFlag==1"></uni-icons>
						<text >{{item.showTime}}</text>
					</view>
					
				<!-- 	<view slot="actions" class="card-actions">
						<view class="card-actions-item" @click="actionsClick('分享')">
							<uni-icons type="pengyouquan" size="18" color="#999"></uni-icons>
							<text class="card-actions-item-text">分享</text>
						</view>
						<view class="card-actions-item" @click="actionsClick('点赞')">
							<uni-icons type="heart" size="18" color="#999"></uni-icons>
							<text class="card-actions-item-text">点赞</text>
						</view>
						<view class="card-actions-item" @click="actionsClick('评论')">
							<uni-icons type="chatbubble" size="18" color="#999"></uni-icons>
							<text class="card-actions-item-text">评论</text>
						</view>
					</view> -->
				</uni-card>
				
			
				
				<uni-fab ref="fab" :pattern="pattern" :content="toolsContent" :horizontal="horizontal" :vertical="vertical"
							:direction="direction" @trigger="trigger" />
			
</template>

<script>
	import constant from '@/store/constant.js'
	
	const baseImageUrl=constant.baseImageUrl;
	import store from '@/store/index.js';//需要引入store
	export default {
			computed:{
				friendDetail(){
					return store.state.friend.friendDetail
				},
				friendNoteList(){
					return store.state.friend.friendNoteList
				},
				toolsContent(){
					return store.state.common.toolsContent
				},
			},
			components: {},
			onLoad(option) {
				
				option.friendId
					
				
				//加载新闻通知数据
				store.dispatch('loadFriendDetail',{"friendId":option.friendId})
				store.dispatch('loadfriendNoteData',{"userId":option.friendId})
				
				
				
				
			},
			data() {
				return {
					imageUrl:baseImageUrl,
					cover: '../../static/bb.png',
				avatar: '../../static/pig.png',
					extraIcon:{
						color: '#4cd964',
						size: '22',
						type: 'gear-filled'
					},
					title: 'uni-fab',
					directionStr: '垂直',
					horizontal: 'right',
					vertical: 'bottom',
					direction: 'horizontal',
					pattern: {
						color: '#7A7E83',
						backgroundColor: '#fff',
						selectedColor: '#007AFF',
						buttonColor: '#007AFF',
						iconColor: '#fff'
					},
					is_color_type: false,
					
				}
			},
			methods: {
				trigger(e) {
					this.toolsContent[e.index].active = !e.item.active
					store.dispatch('toolsJump',e.item.value)
				},
				onClick(e){
					console.log(e)
				},
				actionsClick(text){
					uni.showToast({
						title:text,
						icon:'none'
					})
				}
			}
		}
</script>

<style>
.container {
		overflow: hidden;
	}

	.custom-cover {
		flex: 1;
		flex-direction: row;
		position: relative;
	}

	.cover-content {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 40px;
		background-color: rgba($color: #000000, $alpha: 0.4);
		display: flex;
		flex-direction: row;
		align-items: center;
		padding-left: 15px;
		font-size: 14px;
		color: #fff;
	}

	.card-actions {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		height: 45px;
		border-top: 1px #eee solid;
	}

	.card-actions-item {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.card-actions-item-text {
		font-size: 12px;
		color: #666;
		margin-left: 5px;
	}

	.cover-image {
		flex: 1;
		height: 150px;
	}

	.no-border {
		border-width: 0;
	}
</style>